﻿using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ymatou.ServiceCenter.Domain.IRepositories
{
    public interface IRepositoryBase<TEntity> where TEntity : class
    {
        bool Delete(object id);
        bool Delete(TEntity entity);
        TEntity GetById(object id);
        bool Insert(IEnumerable<TEntity> entities);
        bool Insert(TEntity entity);
        bool Save(TEntity entity);
        bool Update(TEntity entity);
        IList<TEntity> Find(string sql, SqlParameter[] parameters);

    }

    public class PagingInfo<T> where T : class
    {
        public IList<T> List { get; set; }
        public int TotalPages { get; set; }
        public int TotalRecords { get; set; }
    }
}
